package com.dgz.system.controller.user;

import com.dgz.common.core.controller.BaseController;
import com.dgz.common.core.domain.R;
import com.dgz.common.core.domain.TableDataInfo;
import com.dgz.system.domain.user.dto.UserDTO;
import com.dgz.system.domain.user.dto.UserQueryDTO;
import com.dgz.system.service.user.IUserService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: DongGuoZhen
 * @Date: 2025/04/24/13:59
 * @Description:
 */
@Tag(name = "用户接口")
@RestController
@RequestMapping("/user")
public class UserController extends BaseController {


    @Autowired
    private IUserService userService;


    /**
     * 查询用户列表 分页
     *
     * @param userQueryDto
     * @return
     */
    @GetMapping("/list")
    public TableDataInfo list(UserQueryDTO userQueryDto){
        return getTableDataInfo(userService.list(userQueryDto));
    }


    /**
     * 更新用户状态 拉黑 解除拉黑
     * @param userDTO
     * @return
     */
    @PutMapping("/updateStatus")
    public R<Void> updateStatus(@RequestBody UserDTO userDTO) {
        return toR(userService.updateStatus(userDTO));
    }

}
